package javanlp;
import java.io.*;
import opennlp.tools.tokenize.*;
import opennlp.tools.util.*;

public class Toke{	
public static void main(String[] args) 
        throws InvalidFormatException, IOException {
        String fld = "C:/Users/lenovolap/Dropbox/java/NLP.models/";
        String trainedModel = fld+"en-token.zip";
        try (InputStream is = new FileInputStream(trainedModel)) {
            TokenizerModel model = new TokenizerModel(is);
            Tokenizer tokenizer = new TokenizerME(model);
            String tokens[] = tokenizer.tokenize("Hi. How are you? Cool!");

            for (String a : tokens){
                    System.out.println(a);
            }
        }
	}
}